<?php
	$_items = $this->getReviewsCollection()->getItems();
?>
<ul class="reviews-list-page">
<?php
	$i=1; foreach($_items as $_review):
?>
	<li style="margin-bottom:10px; border-bottom:1px solid #999; padding-bottom:10px;">
		<div class="reviews-product-image"></div>
		<div class="reviews-list-detail">
		<dl>
			<dt>
				<?php
					$_product = $this->getProduct($_review->getEntityPkValue());
					$_helper = $this->helper('catalog/output');
				?>
				<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
			</dt>
			<dd>
				<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
				<?php echo $this->getPriceHtml($_product, true) ?>
				<a href="<?php echo Mage::getUrl('review/product/view', array('id' => $_review->getId())); ?>"><?php echo $this->htmlEscape($_review->getTitle()) ?></a> (<?php echo $this->__('Review by <span>%s</span>', $this->htmlEscape($_review->getNickname())) ?>)
				<?php $_votes = $_review->getRatingVotes(); ?>
				<?php
					$percent = 0;
					foreach ($_votes as $_vote){
						$percent += $_vote->getPercent();
					}
					$percent = $percent/count($_votes);
				?>
				<div class="ratings2">
					<table cellspacing="0" cellpadding="0" border="0">
						<tr>
							<td>
								<div class="rating-box">
									<div style="background-position:0 -<?php echo round($percent*0.1)*17 ?>px;" class="rating"></div>
								</div>
							</td>
							<td>
								<span class="pr-rating pr-rounded"><?php echo sprintf("%.1f", $percent/2*0.1) ?></span>
							</td>
						</tr>
					</table>
				</div>
				<?php echo nl2br($this->htmlEscape($_review->getDetail())) ?>				
			</dd>
			<div style="clear:both;"></div>
		</dl>
		</div>
	</li>
<?php
	$i++; endforeach;
?>
</ul>
<?php echo $this->getChildHtml('reviews.toolbar') ?>